﻿<%@ Page Title="Trang chủ" Language="C#" MasterPageFile="~/Luuli.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <form id="form1" runat="server">
    <div class="thanhngang"><div class="giua">Kênh thông tin dịch vụ giá rẻ dành cho người tiêu dùng Việt</div></div>
<div class="giua">
<div class="main">
    <div class="left">
    		<div class="slide">
			<!-- Bắt đầu slide-->
			<div id="">
    <div id="">
        
<input name="hidIsHome" id="hidIsHome" value="1" type="hidden">  
<div id="box-center">
    <div id="center">
        
              
        <script>

            var is_home = window.document.getElementById('hidIsHome').value;
            function LoadConfig(id) {
                var configOffset = jQuery('#adv_config').offset();
                jQuery('html, body').animate({ scrollTop: configOffset.top });

                window.document.getElementById('title').value = window.document.getElementById('hidTitle_' + id).value;
                window.document.getElementById('advStartDate').value = window.document.getElementById('hidAdvStartDate_' + id).value;
                window.document.getElementById('advEndDate').value = window.document.getElementById('hidAdvEndDate_' + id).value;
                window.document.getElementById('link').value = window.document.getElementById('hidLink_' + id).value;

                if (window.document.getElementById('hidIsHome_' + id).value == 1) {
                    window.document.getElementById('is_home').checked = true;
                }
                else {
                    window.document.getElementById('is_home').checked = false;
                }

                if (window.document.getElementById('hidBlank_' + id).value == 1) {
                    window.document.getElementById('blank').checked = true;
                }
                else {
                    window.document.getElementById('blank').checked = false;
                }

                var zones = window.document.getElementById('zones');
                var selectedZones = window.document.getElementById('hidZones_' + id).value;
                if (selectedZones.length) {
                    selectedZones = ',' + selectedZones + ',';
                }
                for (i = 0; i < zones.options.length; i++) {
                    var option = zones.options[i];
                    if (selectedZones.indexOf(',' + option.value + ',') > -1) {
                        option.selected = true;
                    }
                    else {
                        option.selected = false;
                    }
                }


                window.document.getElementById('cmd').value = 'edit';
                window.document.getElementById('id').value = id;
                window.document.getElementById('bannerImg').innerHTML = '<img src="' + window.document.getElementById('hidImg_' + id).value + '" height="100" />';
            }

            function CheckDelete(id) {
                if (confirm('Are you sure?')) {
                    window.document.getElementById('cmd').value = 'delete';
                    window.document.getElementById('id').value = id;
                    window.document.getElementById('banner').click();

                    return true;
                }
                return false;
            }
        
        </script>
                    <div id="box-adv">
					
					</div>
	                <div id="img-other">
            			<div id="slide-boder">
						
						
						</div>
        </div>
	                 
        <script>
            var item_promos = [{ "id": "50", "link": "http://links-1", "blank": "0", "title": "Tieu de 1", "img": "./anh/2.jpg", "img_server": "6", "zones": "3", "catids": "", "is_home": "1", "start_date": null, "end_date": null, "img_large": "./anh/2.jpg", "img_thumb": "./anh/2.jpg", "zone_arr": ["3"], "cat_arr": [""] }, { "id": "58", "link": "http://links-2", "blank": "0", "title": "tieu de 2", "img": "2.jpg", "img_server": "0", "zones": "1", "catids": "", "is_home": "1", "start_date": null, "end_date": null, "img_large": "anh/3.jpg", "img_thumb": "anh/3.jpg", "zone_arr": ["1"], "cat_arr": [""] }, { "id": "70", "link": "http://links-3", "blank": "0", "title": "tieu de 3", "img": "anh/2.jpg", "img_server": "5", "zones": "2", "catids": "", "is_home": "1", "start_date": "0", "end_date": "0", "img_large": "anh/2.jpg", "img_thumb": "anh/2.jpg", "zone_arr": ["2"], "cat_arr": [""] }, { "id": "42", "link": "http://links-4", "blank": "0", "title": "Tieu de 4", "img": "anh/3.jpg", "img_server": "6", "zones": "1", "catids": "", "is_home": "1", "start_date": null, "end_date": null, "img_large": "anh/3.jpg", "img_thumb": "anh/3.jpg", "zone_arr": ["1"], "cat_arr": [""] }, { "id": "68", "link": "http://links5", "blank": "0", "title": "Tieu de 5", "img": "anh/2.jpg", "img_server": "5", "zones": "", "catids": "", "is_home": "1", "start_date": null, "end_date": null, "img_large": "anh/2.jpg", "img_thumb": "anh/2.jpg", "zone_arr": [""], "cat_arr": [""]}];
            var cur_pos = 0;
            var focus_length = 5;
            var is_timer = 0;



            for (i in item_promos) {
                if (i == 0) {
                    jQuery("#box-adv").html('<a ' + (item_promos[i]['blank'] == 1 ? 'target="_blank"' : '') + ' href="' + item_promos[i]['link'] + '" title="' + item_promos[i]['title'] + '"><img src="' + item_promos[i]['img_large'] + '" class="img_border" width="660" height="240"/></a>');

                    if (is_home == 1) {
                        jQuery("#slide-boder").html('<div class="img-select">\
                                                                                                            <div class="arrow"><img src="anh/arrow-slide.gif" with="19" height="10"/></div>\
                                                                                                            <div class="img-selected"><img title="' + item_promos[i]['title'] + '" src="' + item_promos[i]['img_thumb'] + '" height="55"/></div>\
                                                                                              </div>');
                    }
                    else if (focus_length > 1) {
                        jQuery('#curImgNotify').text(cur_pos + 1 + ' / ' + focus_length);
                    }
                }
                else if (is_home == 1) {
                    jQuery("#slide-boder").append('<div class="img-default"><div class="none"><img onclick="promo_focus(' + i + ');" title="' + item_promos[i]['title'] + '" src="' + item_promos[i]['img_thumb'] + '" height="55"/></div></div>');
                }
                if ((is_home == 1) && (i == 4)) {
                    break;
                }
            }

            setOpacity();

            function setOpacity() {
                var obj = jQuery('div[class="none"] img');
                obj.each(function () {
                    jQuery(this).addClass('trans90');
                    jQuery(this).mouseout(function () {
                        jQuery(this).removeClass('hover');
                        jQuery(this).addClass('trans90');
                    });
                    jQuery(this).mouseover(function () {
                        jQuery(this).removeClass('trans90');
                        jQuery(this).addClass('hover');
                    });
                });
            }

            function promo_focus(fstt) {
                if (typeof (item_promos[fstt]) != 'undefined') {
                    cur_pos = fstt;
                    jQuery("#slide-boder").html('');
                    var slide_html = '';
                    for (i in item_promos) {
                        if (!isNaN(i)) {
                            if (i == fstt) {

                                jQuery("#box-adv").html('<a ' + (item_promos[i]['blank'] == 1 ? 'target="_blank"' : '') + ' href="' + item_promos[i]['link'] + '" title="' + item_promos[i]['title'] + '"><img src="' + item_promos[i]['img_large'] + '" class="img_border" width="660" height="240"/></a>');

                                if (is_home == 1) {
                                    slide_html += ('<div class="img-select">\
                                                                                                                                    <div class="arrow"><img src="anh/arrow-slide.gif" with="19" height="10"/></div>\
                                                                                                                                    <div class="img-selected"><img title="' + item_promos[i]['title'] + '" src="' + item_promos[i]['img_thumb'] + '" height="55"/></div>\
                                                                                                                      </div>');
                                }
                                else if (focus_length > 1) {
                                    jQuery('#curImgNotify').text((cur_pos + 1) + ' / ' + focus_length);
                                }
                            }
                            else if (is_home) {

                                slide_html += ('<div class="img-default"><div class="none"><img onclick="promo_focus(' + i + ');" title="' + item_promos[i]['title'] + '" src="' + item_promos[i]['img_thumb'] + '" height="55"/></div></div>');
                            }

                            if ((is_home == 1) && (i == 4)) {
                                break;
                            }
                        }
                    }

                    if (is_home) {
                        jQuery("#slide-boder").html(slide_html);
                    }
                    setOpacity();
                }
            }

            function promo_focus_next(stop_timer) {
                if (focus_length > 1) {
                    jQuery("#pre_button").attr("className", "pre").mouseover(function () { jQuery(this).attr("className", "preOver") }).mouseout(function () { if (is_timer != -1) { jQuery(this).attr("className", "pre") } });
                    jQuery("#stop_button").attr("className", "stop").mouseover(function () { jQuery(this).attr("className", "stopOver") }).mouseout(function () { if (is_timer) { jQuery(this).attr("className", "stop") } });
                    jQuery("#next_button").attr("className", "nextOver").mouseover(function () { }).mouseout(function () { });
                }

                if (stop_timer) {
                    clearTimeout(pfocus_timer);
                }
                cur_pos++;
                if (cur_pos >= focus_length) {
                    cur_pos = 0;
                }

                is_timer = 1;
                promo_focus(cur_pos);
                pfocus_timer = setTimeout("promo_focus_next();", 5000);
            }

            function promo_focus_prev(stop_timer) {
                if (focus_length > 1) {
                    jQuery("#pre_button").attr("className", "preOver").mouseover(function () { }).mouseout(function () { });
                    jQuery("#stop_button").attr("className", "stop").mouseover(function () { jQuery(this).attr("className", "stopOver") }).mouseout(function () { if (is_timer) { jQuery(this).attr("className", "stop") } });
                    jQuery("#next_button").attr("className", "next").mouseover(function () { jQuery(this).attr("className", "nextOver") }).mouseout(function () { if (is_timer != 1) { jQuery(this).attr("className", "next") } });
                }

                if (stop_timer) {
                    clearTimeout(pfocus_timer);
                }

                cur_pos--;
                if (cur_pos < 0) {
                    cur_pos = focus_length - 1;
                }

                is_timer = -1;
                promo_focus(cur_pos);
                pfocus_timer = setTimeout("promo_focus_prev();", 5000);
            }

            function promo_focus_stop() {
                if (focus_length > 1) {
                    jQuery("#pre_button").attr("className", "pre").mouseover(function () { jQuery(this).attr("className", "preOver") }).mouseout(function () { if (is_timer != -1) { jQuery(this).attr("className", "pre") } });
                    jQuery("#stop_button").attr("className", "stopOver").mouseover(function () { }).mouseout(function () { });
                    jQuery("#next_button").attr("className", "next").mouseover(function () { jQuery(this).attr("className", "nextOver") }).mouseout(function () { if (is_timer != 1) { jQuery(this).attr("className", "next") } });
                }

                is_timer = 0;
                clearTimeout(pfocus_timer);
            }
            if (focus_length > 1) {
                jQuery("#next_button").attr("className", "nextOver");
            }
            jQuery(document).ready(function () {
                jQuery("#advStartDate").datepicker();
                jQuery("#advEndDate").datepicker();
                pfocus_timer = setTimeout("promo_focus_next();", 5000);
            });

            function openAdminAdv() {
                if (jQuery('#adv_config').is(':visible')) {
                    jQuery('#adv_config').hide();
                }
                else {
                    jQuery('#adv_config').show();
                }

            }

            function Table1_ondblclick() {

            }

            function Table1_onkeydown() {

            }

        </script>
	              </div>
</div>
</div></div>
 
			<!--Kết thúc slide -->
			<!-- Sản phẩm khuyến mãi-->
            </div>
			<div class="head_sp_move">
            <div id="head_sp1">
				<ul>
                       <li class="current">
                           <asp:ImageButton ID="GGnhieu" runat="server" onclick="GGnhieu_Click" 
                           ToolTip="click để biết được những sản phẩm giảm giá nhiều nhất" 
                           ImageUrl="~/anh/images_Luuli_ver1.0/img_GGN02.png" />
                           </li>
            <li class="current">
                <asp:ImageButton ID="KMnew" runat="server" onclick="KMnew_Click" 
                    ToolTip="click để biết được những sản phẩm khuyến mãi lớn nhất" 
                    ImageUrl="~/anh/images_Luuli_ver1.0/img_KMnew.png"/>
                </li>
           
       </ul>
            </div></div>


      <%--su li san pham--%>

      <div class="sanpham" style="text-align: center">
           <div style="text-align: center;padding-left:35px;padding-top:15px;padding-right:15px">
    <asp:DataList ID="Pgiamgia" runat="server" RepeatColumns="3">
    <ItemTemplate>
    <div style="padding-left:10px;padding-right:12px">   
        <asp:ImageButton ID="HinhSP1" runat="server" ImageUrl='<%#Eval("Hinh_phieu") %>' Height = "204px" Width ="204px" 
        PostBackUrl='<%# "Sanphamchitiet.aspx?name=Pgiamgia&id="+ Eval("Id_phieu") %>' ToolTip='<%#Eval("Tieude_phieu") %>'/>
        <br>
        <asp:Label ID="TenSP1" runat="server" style="color:Black" 
            Text='<%#Eval("Tieude_rut_gon_phieu") %>' />
        <br>
        <span style="color:red">
        <asp:Label ID="price1" runat="server" Text='<%#Eval("Giaban_phieu") %>'/>
        <asp:Label ID="donvi" runat="server" Text="VNđ"></asp:Label>
        </span>
        <br>
        <asp:HyperLink ID="ppgLink" runat="server" Text="Xem thêm phiếu giảm giá" NavigateUrl="Phieu_giam_gia.aspx"/>
        </div>     
    </ItemTemplate>
    </asp:DataList>
        </div>
        <br>
        <div style="text-align: center;padding-left:35px;padding-top:15px;padding-right:15px">
    <asp:DataList ID="Spgiamgia" runat="server" RepeatColumns="4">
    <ItemTemplate>
    <div style="padding-left:10px;padding-right:12px"> 
        <asp:ImageButton ID="HinhSP2" runat="server" ImageUrl='<%#Eval("Hinh_sp") %>' Height = "204px" Width ="204px" 
        PostBackUrl='<%# "Sanphamchitiet.aspx?name=Spgiamgia&id=" + Eval("Id_sp") %>' ToolTip='<%#Eval("Ten_sp") %>' />
        <br>
        <asp:Label ID="TenSP2" runat="server" style="color:Black" 
            Text='<%#Eval("Ten_rut_gon_sp") %>' />
        <br>
        <span style="color:red">
        <asp:Label ID="price2" runat="server" Text='<%#Eval("Giaban_sp") %> '/>
        <asp:Label ID="donvi" runat="server" Text="VNđ"></asp:Label>
        </span>
        <br>
        <asp:HyperLink ID="spggLink" runat="server" Text="Xem thêm sản phẩm giảm giá" NavigateUrl="Spham_giam_gia.aspx"/>
        </div>    
    </ItemTemplate>
    </asp:DataList>
    </div> 
    <br> 
    <div style="text-align: center;padding-left:35px;padding-top:15px;padding-bottom:15px;padding-right:15px">     
    <asp:DataList ID="DDgiamgia" runat="server" RepeatColumns="4">
    <ItemTemplate>
    <div style="padding-left:10px;padding-right:12px">  
        <asp:ImageButton ID="HinhSP3" runat="server" ImageUrl='<%#Eval("Hinh_dd") %>' Height = "204px" Width ="204px" 
        PostBackUrl='<%# "Sanphamchitiet.aspx?name=Ddgiamgia&id=" + Eval("Id_diadiem") %>' ToolTip='<%#Eval("Tieude_dd") %>'/>
        <br>
        <asp:Label ID="TenSP3" runat="server" style="color:Black" 
            Text='<%#Eval("Tieude_rut_gon_dd") %>' />
        <br>
        <span style="color:red">
        <asp:Label ID="price3" runat="server" Text='<%#Eval("Phamtramgiam_dd") %>' />
        <asp:Label ID="donvi" runat="server" Text="%"></asp:Label>
        </span>
        <br>
        <asp:HyperLink ID="DdggLink" runat="server" Text="Xem thêm địa điểm khuyến mãi" NavigateUrl="Dia_diem_khuyen_mai.aspx"/>
        </div>
       </ItemTemplate>
    </asp:DataList>
    </div>
</div>
  			<!-- Doanh nghiệp hay giảm giá-->
			<div class="haygiamgia">
		<table id="Table3" width="761" height="31" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td>
			<img src="anh/menu_01.gif" width="24" height="31" alt=""></td>
		<td width="720" id="haygiamgia">
			Doanh Nghiệp Hay Khuyến Mãi Giảm Giá</td>
		<td>
			<img src="anh/menu_03.gif" width="17" height="31" alt=""></td>
	</tr>
</table>	
		<table id="giamgia_content" width="756" height="159" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td rowspan="2">
			<img src="anh/a_01.gif" width="27" height="82" alt="">
			<img src="anh/a_08.gif" width="26" height="77" alt=""></td>
		<td class="giamgia_content_logo">
			<img src="anh/a_02.gif"  height="82" alt=""></td>
		<td class="giamgia_content_logo">
			<img src="anh/a_03.gif"  height="82" alt=""></td>
		<td class="giamgia_content_logo">
			<img src="anh/a_04.gif"  height="82" alt=""></td>
		<td class="giamgia_content_logo">
			<img src="anh/a_05.gif"  height="82" alt=""></td>
		<td class="giamgia_content_logo">
			<img src="anh/a_06.gif" height="82" alt=""></td>
		<td rowspan="2">
			<img src="anh/a_07.gif" width="26" height="82" alt="">
			<img src="anh/a_14.gif" width="26" height="77" alt=""></td>
	</tr>
	<tr>
		<td class="giamgia_content_logo">
			<img src="anh/a_09.gif"  height="77" alt=""></td>
		<td class="giamgia_content_logo">
			<img src="anh/a_10.gif"  height="77" alt=""></td>
		<td class="giamgia_content_logo">
			<img src="anh/a_11.gif"  height="77" alt=""></td>
		<td class="giamgia_content_logo">
			<img src="anh/a_12.gif" height="77" alt=""></td>
		<td class="giamgia_content_logo">
			<img src="anh/a_13.gif"  height="77" alt=""></td>
		</tr>
</table>
			

			</div>
			<!-- Thông tin từ luuli-->
<div class="info_tu_luuli">
<table width="760" height="33" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td>
			<img src="anh/b_01.gif" width="21" height="33" alt=""></td>
		<td class="info_tu_luuli_head">Thông tin từ &pound;uuli
			</td>
		<td>
			<img src="anh/b_03.gif" width="25" height="33" alt=""></td>
	</tr>
</table>
<table  width="759" height="220"  class="info_tu_luuli_tab"  cellpadding="0" cellspacing="0">
	<tr>
		<td ="190">
			a</td>
		<td id="190">
			a</td>
		<td id="190">
			a</td>
		<td id="190">
			a</td>
	</tr>
</table>
</div>
    </div>
	<!-- menu bên phải-->
	<!-- Giảm giá-->
	<div class="slider">
      <div class="slider_giamgia">
        <div class="slider_mau">
        <span style="margin-bottom:1px">
            <asp:ImageButton ID="giamgiacucsoc" runat="server" ToolTip="Giảm giá cực sốc" 
                ImageUrl="~/anh/images_Luuli_ver1.0/giamgia_01.png" PostBackUrl="GiamGiaDen.aspx?giamgia=100"/>
                </span>
                <span style="margin-bottom:1px">
            <asp:ImageButton ID="ImageButton1" runat="server" ToolTip="Giảm giá đến 90%" 
                ImageUrl="~/anh/images_Luuli_ver1.0/giamgia_02.png" PostBackUrl="GiamGiaDen.aspx?giamgia=90"/>
                </span>
                <span style="margin-bottom:1px">
            <asp:ImageButton ID="ImageButton2" runat="server" ToolTip="Giảm giá đến 70%" 
                ImageUrl="~/anh/images_Luuli_ver1.0/giamgia_03.png" PostBackUrl="GiamGiaDen.aspx?giamgia=70"/>
                </span>
                <span style="margin-bottom:1px">
            <asp:ImageButton ID="ImageButton3" runat="server" ToolTip="Giảm giá đến 50%" 
                ImageUrl="~/anh/images_Luuli_ver1.0/giamgia_04.png" PostBackUrl="GiamGiaDen.aspx?giamgia=50"/>
                </span>
                <span style="margin-bottom:1px">
            <asp:ImageButton ID="ImageButton4" runat="server" ToolTip="Giảm giá đến 30%" 
                ImageUrl="~/anh/images_Luuli_ver1.0/giamgia_05.png" PostBackUrl="GiamGiaDen.aspx?giamgia=30"/>
                </span>
                <span style="margin-bottom:1px">
            <asp:ImageButton ID="ImageButton5" runat="server" ToolTip="Giảm giá đến 20%" 
                ImageUrl="~/anh/images_Luuli_ver1.0/giamgia_06.png" PostBackUrl="GiamGiaDen.aspx?giamgia=20"/>
                </span>
                <span style="margin-bottom:1px">
            <asp:ImageButton ID="ImageButton6" runat="server" ToolTip="Giảm giá đến 10%" 
                ImageUrl="~/anh/images_Luuli_ver1.0/giamgia_07.png" PostBackUrl="GiamGiaDen.aspx?giamgia=10"/>
                </span>
        </div>
       </div>

	   <!-- Truy cập-->
	 	<div class="truycap_top">
      		<div class="slider_left">Tổng lượt truy cập: </div>
             <asp:Label ID="Tongtruycap_value" runat="server" Text="Label" CssClass="slider_right"></asp:Label>
      		<%--<div class="slider_right"> 123,456,789</div>--%>
     	</div>
      	<div class="border_do">
        <div class="slider_left">Truy cập hiện tại :<br />Truy cập ngày :<br />Truy cập tuần :<br /> Truy cập tháng :</div>
              <%--<asp:Label ID="Truycaphientai_label" runat="server" Text="Truy cập hiện tại :"></asp:Label>--%>
        	<asp:Label ID="Truycaphientai_value" runat="server" Text="Label" 
                  CssClass="slider_right"></asp:Label>
     	<br />
              <%--<asp:Label ID="Truycapngay_label" runat="server" Text="Truy cập ngày :"></asp:Label>--%>
        	<asp:Label ID="Truycapngay_value" runat="server" Text="Label" 
                  CssClass="slider_right"></asp:Label>
        	  <br />
              <%--<asp:Label ID="Truycaptuan_label" runat="server" Text="Truy cập tuần :"></asp:Label>--%>
        	<asp:Label ID="Truycaptuan_value" runat="server" Text="Label" 
                  CssClass="slider_right"></asp:Label>
     	      <br />
              <%--<asp:Label ID="Truycapthang_label" runat="server" Text="Truy cập tháng :"></asp:Label>--%>
        	<asp:Label ID="Truycathang_value" runat="server" Text="Label" 
                  CssClass="slider_right"></asp:Label>
     	</div>
 		<!-- Menu con-->
    	<div class="head_menu">Bạn muốn nhận tin báo giá mỗi ngày</div>
     	<div class="content_menu">
        <asp:TextBox ID="emailBox" runat="server" style="width:210px;Height:30px"></asp:TextBox>
        <asp:Button ID="sendEmail" runat="server" Text="Button" style="width:16px"/>
        </div>
        

        	
           
</div></div>
    </form>
</asp:Content>

